import React, { useEffect, useRef, useState } from 'react';
import styles from './index.less';
import { Carousel } from 'antd';


const DateCarousel: React.FC<any> = ({
    timeDataSource
}) => {
    const [actionMonth, setActionMonth ] = useState<any>(new Date().getMonth()+1)


    return (
        <div>
            <Carousel slidesToShow={4} dots={true} infinite={true}>
                {
                    timeDataSource.map((item,index)=>{
                        let text = new Date(item.currentDate).getFullYear()+'年'+(new Date(item.currentDate).getMonth()+1)+'月';
                        return (
                            <div 
                                key={item.id}
                                style={{width:'120px !important'}}
                            >
                                <h3 className={styles.swiperSlide}>
                                    {text}
                                </h3>
                            </div>
                        )
                    })
                }
            </Carousel>
        </div>
    )
}

export default DateCarousel;